let id = 0;

class Dep {
    constructor() {
        this.id = id++;
        this.subs = []; // 存放 watcher 的容器
    }
    depend() {
        if(Dep.target) {
            Dep.target.addDep(this);
        }
    }
    notify() {
        this.subs.forEach(watcher => watcher.update())
    }
}

export default Dep;